<template>


  <view class="header">

    <view class="flex bg-gray justify-end  text-xxl ">

      <view class="margin-sm">

        <text class="cuIcon-search">

        </text>
      </view>

      <view class="margin-sm">

        <text class="cuIcon-settings">

        </text>
      </view>
    </view>
    <view style="display:block;">
      <nut-tabs v-model="tabIndex">
        <nut-tab-pane v-for="(item,index) in tabList"
                      :title="item.title">

        </nut-tab-pane>

      </nut-tabs>
    </view>

    <view class="swiper">
      <nut-swiper style="height: 200px;width: 100%" :pagination-visible="true" pagination-color="#426543"
                  auto-play="3000">
        <nut-swiper-item>
          <img src="https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg" alt=""/>
        </nut-swiper-item>
        <nut-swiper-item>
          <img src="https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg" alt=""/>
        </nut-swiper-item>
        <nut-swiper-item>
          <img src="https://storage.360buyimg.com/jdc-article/welcomenutui.jpg" alt=""/>
        </nut-swiper-item>
        <nut-swiper-item>
          <img src="https://storage.360buyimg.com/jdc-article/fristfabu.jpg" alt=""/>
        </nut-swiper-item>
      </nut-swiper>

    </view>
  </view>
  <swiper class="" circular :current="tabIndex" @change="siwperChange"
          style="width: 100%;height:950rpx; margin-top: 294px;  position:fixed;">
    <swiper-item v-for="(sitem,sindex) in tabList">
      <scroll-view :scroll-y="true" style="width: 100%;height:950rpx;">
        <view class="flex bg-white solid-bottom" v-for="(item,index) in articleList">
          <view class="basis-lg flex-direction align-center justify-between padding">
            <view class="text-title text-lg text-bold text-black ">
              {{ item.title }}
            </view>
            <view class="flex justify-between text-gray align-center margin-top-xs">
              <view class="flex">
                <view>
                  {{ item.time }}
                </view>
                <view>
                  {{ item.tag }}
                </view>
              </view>
              <view class="flex">
                <text class="cuIcon-message">
                </text>
                <view>
                  {{ item.comments }}

                </view>
              </view>
            </view>
          </view>
          <view class="basis-df">
            <image class="padding-sm"
                   style="height: 100px;width: 100%"
                   :src="item.img">
            </image>
          </view>

        </view>
      </scroll-view>

    </swiper-item>

  </swiper>


</template>

<script>
export default {
  data() {
    return {
      title: 'Hello',
      tabIndex: 0,
      tabList: [
        {
          title: "热门"
        },
        {
          title: "推荐"
        },
        {
          title: "关注"
        }, {
          title: "附近"
        }
      ],
      articleList: [

        {
          title: "标题标题标题标题标题标题标题标题标题",
          img: "https://storage.360buyimg.com/jdc-article/fristfabu.jpg",
          url: "http://localhost:8080",
          time: "47分钟前",
          tag: "主机游戏",
          comments: "99+"
        },
        {
          title: "标题标题标题标题标题标题标题标题标题",
          img: "https://storage.360buyimg.com/jdc-article/fristfabu.jpg",
          url: "http://localhost:8080",
          time: "47分钟前",
          tag: "主机游戏",
          comments: "99+"
        },
        {
          title: "标题标题标题标题标题标题标题标题标题",
          img: "https://storage.360buyimg.com/jdc-article/fristfabu.jpg",
          url: "http://localhost:8080",
          time: "47分钟前",
          tag: "主机游戏",
          comments: "99+"
        },
        {
          title: "标题标题标题标题标题标题标题标题标题",
          img: "https://storage.360buyimg.com/jdc-article/fristfabu.jpg",
          url: "http://localhost:8080",
          time: "47分钟前",
          tag: "主机游戏",
          comments: "99+"
        },
        {
          title: "标题标题标题标题标题标题标题标题标题",
          img: "https://storage.360buyimg.com/jdc-article/fristfabu.jpg",
          url: "http://localhost:8080",
          time: "47分钟前",
          tag: "主机游戏",
          comments: "99+"
        },
        {
          title: "标题标题标题标题标题标题标题标题标题",
          img: "https://storage.360buyimg.com/jdc-article/fristfabu.jpg",
          url: "http://localhost:8080",
          time: "47分钟前",
          tag: "主机游戏",
          comments: "99+"
        }
      ]
    }
  },
  onLoad() {
  },
  methods: {
    siwperChange(e) {
      this.tabIndex = e.detail.current
    }
  },
}
</script>

<style>


.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 200rpx;
  width: 200rpx;
  margin-top: 200rpx;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50rpx;
}

.text-area {
  display: flex;
  justify-content: center;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
}

.nut-tabpane {
  padding: 0 !important;
}

.text-title {
  min-width: 100px;
  font-size: 18px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.85);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.header {
  position: fixed;
  z-index: 100000;
  width: 750rpx;
  top: 0;

}


</style>
